Run this command to install the SDK:
npm install cloudmersive-convert-api-client --save
Or add this snippet to your package.json:
"dependencies": { "cloudmersive-convert-api-client": "^2.6.3" }
Run this command to install the SDK:
npm install cloudmersive-convert-api-client --save
Or add this snippet to your package.json:
"dependencies": { "cloudmersive-convert-api-client": "^2.6.3" }
var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;
// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';
var apiInstance = new CloudmersiveConvertApiClient.EditDocumentApi();
var reqConfig = new CloudmersiveConvertApiClient.DocxSetHeaderRequest(); // DocxSetHeaderRequest | Document input request
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.editDocumentDocxSetHeader(reqConfig, callback);
Run this command to install the SDK:
pip install cloudmersive-convert-api-client
from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_convert_api_client.EditDocumentApi(cloudmersive_convert_api_client.ApiClient(configuration))
req_config = cloudmersive_convert_api_client.DocxSetHeaderRequest() # DocxSetHeaderRequest | Document input request
try:
# Set the header in a Word DOCX document
api_response = api_instance.edit_document_docx_set_header(req_config)
pprint(api_response)
except ApiException as e:
print("Exception when calling EditDocumentApi->edit_document_docx_set_header: %s\n" % e)
Run this command to install the SDK:
Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 3.4.2
Run this command to install the SDK:
Install-Package Cloudmersive.APIClient.NETCore.DocumentAndDataConvert -Version 2.2.1
using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;
namespace Example
{
public class EditDocumentDocxSetHeaderExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new EditDocumentApi();
var reqConfig = new DocxSetHeaderRequest(); // DocxSetHeaderRequest | Document input request
try
{
// Set the header in a Word DOCX document
DocxSetHeaderResponse result = apiInstance.EditDocumentDocxSetHeader(reqConfig);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling EditDocumentApi.EditDocumentDocxSetHeader: " + e.Message );
}
}
}
}
using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NETCore.DocumentAndDataConvert.Api;
using Cloudmersive.APIClient.NETCore.DocumentAndDataConvert.Client;
using Cloudmersive.APIClient.NETCore.DocumentAndDataConvert.Model;
namespace Example
{
public class EditDocumentDocxSetHeaderExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new EditDocumentApi();
var reqConfig = new DocxSetHeaderRequest(); // DocxSetHeaderRequest | Document input request
try
{
// Set the header in a Word DOCX document
DocxSetHeaderResponse result = apiInstance.EditDocumentDocxSetHeader(reqConfig);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling EditDocumentApi.EditDocumentDocxSetHeader: " + e.Message );
}
}
}
}
To install with Maven, add a reference to the repository in pom.xml:
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
And add a reference to the dependency in pom.xml:
<dependencies> <dependency> <groupId>com.github.Cloudmersive</groupId> <artifactId>Cloudmersive.APIClient.Java</artifactId> <version>v4.25</version> </dependency> </dependencies>
To install with Gradle, add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
And add the dependency in build.gradle:
dependencies { implementation 'com.github.Cloudmersive:Cloudmersive.APIClient.Java:v4.25' }
// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.EditDocumentApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.setApiKeyPrefix("Token");
EditDocumentApi apiInstance = new EditDocumentApi();
DocxSetHeaderRequest reqConfig = new DocxSetHeaderRequest(); // DocxSetHeaderRequest | Document input request
try {
DocxSetHeaderResponse result = apiInstance.editDocumentDocxSetHeader(reqConfig);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EditDocumentApi#editDocumentDocxSetHeader");
e.printStackTrace();
}
Run this command to install the SDK:
composer require cloudmersive/cloudmersive_document_convert_api_client
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
$apiInstance = new Swagger\Client\Api\EditDocumentApi(
new GuzzleHttp\Client(),
$config
);
$req_config = new \Swagger\Client\Model\DocxSetHeaderRequest(); // \Swagger\Client\Model\DocxSetHeaderRequest | Document input request
try {
$result = $apiInstance->editDocumentDocxSetHeader($req_config);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EditDocumentApi->editDocumentDocxSetHeader: ', $e->getMessage(), PHP_EOL;
}
?>
Add the Objective-C client to your Podfile:
pod 'CloudmersiveDocumentAndDataConvertApiClient', '~> 1.0'
CMDefaultConfiguration *apiConfig = [CMDefaultConfiguration sharedConfig];
// Configure API key authorization: (authentication scheme: Apikey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Apikey"];
CMDocxSetHeaderRequest* reqConfig = [[CMDocxSetHeaderRequest alloc] init]; // Document input request
CMEditDocumentApi*apiInstance = [[CMEditDocumentApi alloc] init];
// Set the header in a Word DOCX document
[apiInstance editDocumentDocxSetHeaderWithReqConfig:reqConfig
completionHandler: ^(CMDocxSetHeaderResponse* output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error calling CMEditDocumentApi->editDocumentDocxSetHeader: %@", error);
}
}];
Add the Ruby client to your Gemfile:
gem 'cloudmersive-convert-api-client', '~> 2.1.6'
# load the gem
require 'cloudmersive-convert-api-client'
# setup authorization
CloudmersiveConvertApiClient.configure do |config|
# Configure API key authorization: Apikey
config.api_key['Apikey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Apikey'] = 'Bearer'
end
api_instance = CloudmersiveConvertApiClient::EditDocumentApi.new
req_config = CloudmersiveConvertApiClient::DocxSetHeaderRequest.new # DocxSetHeaderRequest | Document input request
begin
#Set the header in a Word DOCX document
result = api_instance.edit_document_docx_set_header(req_config)
p result
rescue CloudmersiveConvertApiClient::ApiError => e
puts "Exception when calling EditDocumentApi->edit_document_docx_set_header: #{e}"
end
SwagEditDocumentApi api = new SwagEditDocumentApi();
SwagClient client = api.getClient();
// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) client.getAuthentication('Apikey');
Apikey.setApiKey('YOUR API KEY');
Map<String, Object> params = new Map<String, Object>{
'reqConfig' => SwagDocxSetHeaderRequest.getExample()
};
try {
// cross your fingers
SwagDocxSetHeaderResponse result = api.editDocumentDocxSetHeader(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
Install libcurl in your C/C++ project:
libcurl/7.75.0
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "https://api.cloudmersive.com/convert/edit/docx/set-header");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "Apikey: YOUR-API-KEY-HERE");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "InputFileBytes=%3Cbyte%3E&InputFileUrl=%3Cstring%3E&Path=amet%20aliquip%20dolor&Paragraphs=%5B%7B%22ParagraphIndex%22%3A23519878%2C%22Path%22%3A%22quis%20sed%20anim%20consequat%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A-51311886%2C%22Path%22%3A%22deserunt%20exercitation%20sunt%20d%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22tempor%20sed%20laborum%22%2C%22FontFamily%22%3A%22Ut%20culpa%20ullamco%22%2C%22FontSize%22%3A%22tempo%22%7D%2C%7B%22RunIndex%22%3A-38036620%2C%22Path%22%3A%22fugiat%20laborum%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22adipisicing%20et%20veniam%20dolor%20dolore%22%2C%22FontFamily%22%3A%22et%20ad%20ea%22%2C%22FontSize%22%3A%22minim%20mollit%22%7D%5D%2C%22StyleID%22%3A%22ad%20qui%22%7D%2C%7B%22ParagraphIndex%22%3A20970687%2C%22Path%22%3A%22occaecat%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A-24257187%2C%22Path%22%3A%22ex%20et%20nisi%20in%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22culpa%22%2C%22FontFamily%22%3A%22est%20minim%22%2C%22FontSize%22%3A%22tempor%20deserunt%20culpa%22%7D%2C%7B%22RunIndex%22%3A-92137884%2C%22Path%22%3A%22ullamco%20laboris%20non%20id%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22nostrud%20Ut%20ea%20Duis%22%2C%22FontFamily%22%3A%22deserunt%20minim%20eu%20id%22%2C%22FontSize%22%3A%22tempor%20exercitation%20sed%20Ut%20in%22%7D%5D%2C%22StyleID%22%3A%22proident%20dolore%20aliquip%20qui%22%7D%5D&SectionsWithHeader=%5B%7B%22StartingPageNumbers%22%3A%5B61847595%2C48409048%5D%2C%22Path%22%3A%22nulla%20ex%20commodo%20in%22%7D%2C%7B%22StartingPageNumbers%22%3A%5B-79402917%2C-45662177%5D%2C%22Path%22%3A%22eiusmod%20in%22%7D%5D";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
curl --location --request POST 'https://api.cloudmersive.com/convert/edit/docx/set-header' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Apikey: YOUR-API-KEY-HERE' \
--data-urlencode 'InputFileBytes=<byte>' \
--data-urlencode 'InputFileUrl=<string>' \
--data-urlencode 'Path=occaecat nulla irure cupidatat' \
--data-urlencode 'Paragraphs=[{"ParagraphIndex":35080409,"Path":"magna labore","ContentRuns":[{"RunIndex":23727886,"Path":"adipisicing ullamco fugiat ei","TextItems":[{"value":"<Error: Too many levels of nesting to fake this schema>"},{"value":"<Error: Too many levels of nesting to fake this schema>"}],"Bold":true,"Italic":false,"Underline":"anim enim do ex","FontFamily":"ut Lorem sit","FontSize":"voluptate cillum non aliqua reprehenderit"},{"RunIndex":44886031,"Path":"eiusmod Lorem occaecat","TextItems":[{"value":"<Error: Too many levels of nesting to fake this schema>"},{"value":"<Error: Too many levels of nesting to fake this schema>"}],"Bold":false,"Italic":false,"Underline":"cupidatat consectetur ullamco fugiat sunt","FontFamily":"cillum in","FontSize":"mollit pariatur do Excepteur laborum"}],"StyleID":"dolor consectetur"},{"ParagraphIndex":-85509226,"Path":"culp","ContentRuns":[{"RunIndex":-85403308,"Path":"qui cupidatat non quis","TextItems":[{"value":"<Error: Too many levels of nesting to fake this schema>"},{"value":"<Error: Too many levels of nesting to fake this schema>"}],"Bold":true,"Italic":false,"Underline":"est eu","FontFamily":"reprehenderit","FontSize":"anim laboris dolore ut sed"},{"RunIndex":-59153699,"Path":"velit incididunt","TextItems":[{"value":"<Error: Too many levels of nesting to fake this schema>"},{"value":"<Error: Too many levels of nesting to fake this schema>"}],"Bold":true,"Italic":false,"Underline":"dolore et in","FontFamily":"proident adipisicing magna","FontSize":"ut laborum"}],"StyleID":"cupidatat eu occaecat do"}]' \
--data-urlencode 'SectionsWithHeader=[{"StartingPageNumbers":[-21559066,1453391],"Path":"et quis dolor laboris amet"},{"StartingPageNumbers":[3017447,49104010],"Path":"fugiat amet laborum in nostrud"}]'
import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "InputFileBytes=%3Cbyte%3E&InputFileUrl=%3Cstring%3E&Path=ex%20laborum%20sint%20e&Paragraphs=%5B%7B%22ParagraphIndex%22%3A11272581%2C%22Path%22%3A%22dolore%20sit%20et%20veniam%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A-59325974%2C%22Path%22%3A%22ut%20pariatur%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Afalse%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22deserunt%20ut%22%2C%22FontFamily%22%3A%22incididunt%20nulla%20ul%22%2C%22FontSize%22%3A%22officia%20ex%22%7D%2C%7B%22RunIndex%22%3A-8307344%2C%22Path%22%3A%22aute%20qui%20exercitation%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Afalse%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22incididunt%20eu%20officia%20voluptate%20pariatur%22%2C%22FontFamily%22%3A%22ipsum%20pariatur%20eu%22%2C%22FontSize%22%3A%22consectetur%20tempor%20in%20incididunt%20voluptate%22%7D%5D%2C%22StyleID%22%3A%22ea%20cupidatat%20nostrud%22%7D%2C%7B%22ParagraphIndex%22%3A-24601438%2C%22Path%22%3A%22culpa%20sed%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A14036002%2C%22Path%22%3A%22voluptate%20est%20Lorem%20Ut%20ipsum%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Afalse%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22Duis%20cupidatat%20reprehenderit%20laborum%22%2C%22FontFamily%22%3A%22sit%22%2C%22FontSize%22%3A%22ut%20quis%22%7D%2C%7B%22RunIndex%22%3A-6961141%2C%22Path%22%3A%22do%20in%20n%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22sint%20elit%20labore%20et%22%2C%22FontFamily%22%3A%22sed%22%2C%22FontSize%22%3A%22et%22%7D%5D%2C%22StyleID%22%3A%22consectetur%20quis%22%7D%5D&SectionsWithHeader=%5B%7B%22StartingPageNumbers%22%3A%5B-91326024%2C27380907%5D%2C%22Path%22%3A%22voluptate%20laboris%20qui%20in%20ullamco%22%7D%2C%7B%22StartingPageNumbers%22%3A%5B67699402%2C67228632%5D%2C%22Path%22%3A%22culpa%20mollit%22%7D%5D"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://api.cloudmersive.com/convert/edit/docx/set-header")!,timeoutInterval: Double.infinity)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.addValue("YOUR-API-KEY-HERE", forHTTPHeaderField: "Apikey")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
This code snippet uses the built-in JavaScript XHR request capability
Run this command to install jQuery:
bower install jquery
var data = "InputFileBytes=%3Cbyte%3E&InputFileUrl=%3Cstring%3E&Path=dolore%20occaecat%20fugiat&Paragraphs=%5B%7B%22ParagraphIndex%22%3A43884324%2C%22Path%22%3A%22dolor%20ea%20deserunt%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A15494277%2C%22Path%22%3A%22velit%20veniam%20laboris%20ad%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22laborum%20nisi%20aute%22%2C%22FontFamily%22%3A%22Ut%22%2C%22FontSize%22%3A%22exercitation%20deserunt%20aliquip%22%7D%2C%7B%22RunIndex%22%3A40679373%2C%22Path%22%3A%22adipisicing%20Duis%20in%20incididunt%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22sint%20Duis%22%2C%22FontFamily%22%3A%22dolor%20eu%20dolore%22%2C%22FontSize%22%3A%22officia%20ullamco%20in%22%7D%5D%2C%22StyleID%22%3A%22veniam%20ullamco%22%7D%2C%7B%22ParagraphIndex%22%3A67932064%2C%22Path%22%3A%22reprehenderit%20Lorem%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A-64932647%2C%22Path%22%3A%22anim%20voluptate%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22ut%20do%22%2C%22FontFamily%22%3A%22%22%2C%22FontSize%22%3A%22nostrud%20elit%20reprehenderit%20magna%22%7D%2C%7B%22RunIndex%22%3A-33737952%2C%22Path%22%3A%22amet%20aute%20commodo%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22exercitation%20enim%22%2C%22FontFamily%22%3A%22dolor%22%2C%22FontSize%22%3A%22sunt%20labore%20non%20Lorem%22%7D%5D%2C%22StyleID%22%3A%22sunt%20veniam%20id%22%7D%5D&SectionsWithHeader=%5B%7B%22StartingPageNumbers%22%3A%5B-39480702%2C-12683799%5D%2C%22Path%22%3A%22ut%22%7D%2C%7B%22StartingPageNumbers%22%3A%5B-50332190%2C-8485479%5D%2C%22Path%22%3A%22consectetur%20consequat%20sunt%20exercitation%22%7D%5D";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.cloudmersive.com/convert/edit/docx/set-header");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Apikey", "YOUR-API-KEY-HERE");
xhr.send(data);
var settings = {
"url": "https://api.cloudmersive.com/convert/edit/docx/set-header",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
"Apikey": "YOUR-API-KEY-HERE"
},
"data": {
"InputFileBytes": "<byte>",
"InputFileUrl": "<string>",
"Path": "est te",
"Paragraphs": "[{\"ParagraphIndex\":-41665639,\"Path\":\"dolore cillum in ipsum\",\"ContentRuns\":[{\"RunIndex\":27557,\"Path\":\"officia non adipisicing nostrud nisi\",\"TextItems\":[{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"},{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"}],\"Bold\":false,\"Italic\":true,\"Underline\":\"elit anim dolore et magna\",\"FontFamily\":\"in laborum anim\",\"FontSize\":\"aliquip eu sed\"},{\"RunIndex\":40036251,\"Path\":\"nostrud incididunt commodo dolore\",\"TextItems\":[{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"},{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"}],\"Bold\":true,\"Italic\":true,\"Underline\":\"occaecat velit \",\"FontFamily\":\"id \",\"FontSize\":\"velit reprehenderit\"}],\"StyleID\":\"quis eu\"},{\"ParagraphIndex\":-22667128,\"Path\":\"et velit laboris\",\"ContentRuns\":[{\"RunIndex\":3163097,\"Path\":\"et fugiat ut\",\"TextItems\":[{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"},{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"}],\"Bold\":true,\"Italic\":true,\"Underline\":\"sunt occaecat eu cillum\",\"FontFamily\":\"Excepteur dolor incididunt aute\",\"FontSize\":\"in ipsum fugiat Duis\"},{\"RunIndex\":57969284,\"Path\":\"Ut mollit elit\",\"TextItems\":[{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"},{\"value\":\"<Error: Too many levels of nesting to fake this schema>\"}],\"Bold\":true,\"Italic\":false,\"Underline\":\"in\",\"FontFamily\":\"voluptate esse\",\"FontSize\":\"aliqua anim\"}],\"StyleID\":\"amet incididunt \"}]",
"SectionsWithHeader": "[{\"StartingPageNumbers\":[-19376944,4456211],\"Path\":\"in occaecat velit\"},{\"StartingPageNumbers\":[-45295893,-30917727],\"Path\":\"Lorem Excepteur aute minim culpa\"}]"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.cloudmersive.com/convert/edit/docx/set-header"
method := "POST"
payload := strings.NewReader("InputFileBytes=%3Cbyte%3E&InputFileUrl=%3Cstring%3E&Path=ut%20officia%20aliquip%20Excepteur&Paragraphs=%5B%7B%22ParagraphIndex%22%3A95430877%2C%22Path%22%3A%22velit%20sunt%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A-38757724%2C%22Path%22%3A%22occaecat%20sit%20sed%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Afalse%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22incididunt%20veniam%22%2C%22FontFamily%22%3A%22labore%20id%22%2C%22FontSize%22%3A%22pariatur%20commodo%20Excepteur%22%7D%2C%7B%22RunIndex%22%3A39568907%2C%22Path%22%3A%22pariatur%20dolor%20repre%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Afalse%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22ex%20cupidatat%20quis%22%2C%22FontFamily%22%3A%22dolore%20officia%20nisi%22%2C%22FontSize%22%3A%22laborum%20dolor%20aute%22%7D%5D%2C%22StyleID%22%3A%22exercitation%20sed%20quis%20ea%20officia%22%7D%2C%7B%22ParagraphIndex%22%3A-14850793%2C%22Path%22%3A%22ea%22%2C%22ContentRuns%22%3A%5B%7B%22RunIndex%22%3A32816740%2C%22Path%22%3A%22et%20cillum%20aliqua%20in%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Atrue%2C%22Underline%22%3A%22elit%20sunt%22%2C%22FontFamily%22%3A%22reprehenderit%20in%20ullamco%22%2C%22FontSize%22%3A%22%22%7D%2C%7B%22RunIndex%22%3A61834049%2C%22Path%22%3A%22velit%20occaecat%20laboris%20irure%22%2C%22TextItems%22%3A%5B%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%2C%7B%22value%22%3A%22%3CError%3A%20Too%20many%20levels%20of%20nesting%20to%20fake%20this%20schema%3E%22%7D%5D%2C%22Bold%22%3Atrue%2C%22Italic%22%3Afalse%2C%22Underline%22%3A%22proident%20sit%20e%22%2C%22FontFamily%22%3A%22deserunt%20irure%20reprehenderit%20sunt%22%2C%22FontSize%22%3A%22labore%20consectetur%20ea%20aute%22%7D%5D%2C%22StyleID%22%3A%22amet%20do%20nulla%20fugiat%20enim%22%7D%5D&SectionsWithHeader=%5B%7B%22StartingPageNumbers%22%3A%5B-54328942%2C-86400033%5D%2C%22Path%22%3A%22laboris%20reprehenderit%20labore%22%7D%2C%7B%22StartingPageNumbers%22%3A%5B-89592194%2C-59779645%5D%2C%22Path%22%3A%22officia%20Lorem%20non%20sunt%22%7D%5D")
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
req.Header.Add("Apikey", "YOUR-API-KEY-HERE")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}